home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Information / AmiBench / InstallAmiBench < prev    next >
Text File  |  2000-03-01  |  5KB  |  245 lines

  1. ; $VER: AmiBench Installer 1.0 (29.2.2000) Neil Bothwick
  2.  
  3. ;========================== Define Procedures ==========================
  4. ;;; Setup message, prompt and help strings
  5. (procedure SetStrings
  6.     (set
  7.         WelcomeMsg1
  8.             (cat
  9.                 '\nWelcome to the ' @app-name ' software installation.\n'
  10.                 '\nThis will install or update the ' @app-name '\n'
  11.                 'along with any required MUI classes.\n'
  12.             )
  13.         WelcomeMsg2
  14.             (cat
  15.                 '\nThis installer will also update your data files, but only if the files '
  16.                 'on the CD are later than your current installation.\n\n'
  17.                 'It will not overwrite newer data that you have downloaded.'
  18.             )
  19.         DirMsg
  20.             (cat
  21.                 'Where do you want to install ' @app-name'?\n'
  22.                 'A directory will NOT be created.'
  23.             )
  24.         DirHelp
  25.             (cat
  26.                 'Choose the path to create a directory for ' @app-name
  27.             )
  28.         IconSetPrompt
  29.             (cat
  30.                 '\nWhich icon style do you want to install for ' @app-name '?\n'
  31.             )
  32.         IconSetHelp
  33.             (cat
  34.                 '\nIcons are available in OS 3.5, NewIcon, Magic Workbench and Original styles.\n'
  35.                 '\nSelect whichever you prefer.'
  36.             )
  37.         AssignPrompt
  38.             (cat
  39.                 '\n' @app-name ' needs an assign of ADD: to be added to your user-startup.\n\n'
  40.                 'Should it be added now?'
  41.             )
  42.         AssignHelp
  43.             (cat
  44.                 'The ADD: assign is needed by ' @app-name ' whenver you update the data files, '
  45.                 'either online or from a CD. It should be added to your user-startup by this Installer.'
  46.             )
  47.     )
  48. )
  49. ;;;
  50. ;;; Abort with message
  51. (procedure GetOut GetOutMsg
  52.     (message GetOutMsg)
  53.     (exit (quiet))
  54. )
  55. ;;;
  56. ;;; Say hello :-}
  57. (procedure WaitX (set X 1) ( (while (< X 300)  (set X (+ X 1)) )  ) )
  58. (procedure LineFeed lines
  59.     (substr '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' 0 lines)
  60. )
  61.  
  62. (procedure SayHello
  63.     (set
  64.         Line1   '\nWelcome to the'
  65.         Line2   @app-name
  66.         Line3   'software installation'
  67.     )
  68.     (set LFs 12 LFmin 1)
  69.     (while (> LFs LFmin)
  70.         (working (cat (LineFeed LFs) Line1)) (WaitX)
  71.         (set LFs (- Lfs 1))
  72.     )
  73.     (WaitX)
  74.     (set LFs 12 LFmin 3)
  75.     (while (> LFs LFmin)
  76.         (working (cat Line1 (LineFeed LFs) Line2)) (WaitX)
  77.         (set LFs (- Lfs 1))
  78.     )
  79.     (WaitX)
  80.     (set LFs 9 LFmin 2)
  81.     (while (> LFs LFmin)
  82.         (working (cat Line1 (LineFeed 3) Line2 (LineFeed LFs) Line3)) (WaitX)
  83.         (set LFs (- Lfs 1))
  84.     )
  85.     (message (cat '\n\n' Line1 (LineFeed 3) Line2 (LineFeed 3) Line3))
  86.     (message WelcomeMsg1)
  87.     (message WelcomeMsg2)
  88.     (welcome)
  89. )
  90. ;;;
  91. ;;; Check for existing installation
  92. (procedure CheckForInstall
  93.     (set Update (= 2 (exists 'ADD:' (noreq))))
  94. )
  95. ;;;
  96. ;;; Get install directory
  97. (procedure GetDrawer
  98.     (set InstallDir
  99.         (askdir
  100.             (prompt DirMsg)
  101.             (help DirHelp)
  102.             (if Update
  103.                 (default (getassign 'ADD'))
  104.                 (
  105.                     (default 'RAM:')
  106.                     (disk)
  107.                 )
  108.             )
  109.         )
  110.     )
  111.     (makeassign 'ADD' InstallDir)
  112.     (set @default-dest InstallDir)
  113. )
  114. ;;;
  115. ;;; Ask which type of icon should be used
  116. (procedure GetIconSet
  117.     (if (exists (tackon InstallDir 'AmiBench.info'))
  118.         (set IconSet 4)
  119.         (set IconSet
  120.             (askchoice
  121.                 (prompt '\nWhich icon style do you want to install?\n')
  122.                 (help IconSetHelp)
  123.                 (choices
  124.                     '\x1B[2pOS 3.5 Icons'
  125.                     'MagicWB Icons'
  126.                     'NewIcons'
  127.                     'Pre-OS 3.5 Icons'
  128.                 )
  129.                 (default 0)
  130.             )
  131.         )
  132.     )
  133. )
  134. ;;;
  135. ;;; Copy executable and guide
  136. (procedure CopyMain
  137.     (copylib
  138.         (prompt '\nCopying AmiBench\n')
  139.         (help 'This copies the AmiBench executable')
  140.         (source 'AmiBench')
  141.         (dest InstallDir)
  142.     )
  143.  
  144.     (copylib
  145.         (prompt '\nCopying ADD.guide\n')
  146.         (help 'This copies the AmiBench documentation')
  147.         (source 'ADD.guide')
  148.         (dest InstallDir)
  149.     )
  150. )
  151. ;;;
  152. ;;; Copy icons
  153. (procedure CopyIcons
  154.     (set IconDir
  155.         (tackon
  156.             'Icons'
  157.             (select IconSet
  158.                 ('OS35')
  159.                 ('MWB')
  160.                 ('NI')
  161.                 ('OS30')
  162.                 ('NOICONSTOCOPY')
  163.             )
  164.         )
  165.     )
  166.     (if (exists IconDir)
  167.         (copyfiles
  168.             (prompt '\nCopying icons\n')
  169.             (help 'Copying the selected icon set')
  170.             (source IconDir)
  171.             (dest InstallDir)
  172.             (all)
  173.         )
  174.     )
  175. )
  176. ;;;
  177. ;;; Install MUI classes and libs
  178. (procedure CopyClasses
  179.     (copylib
  180.         (prompt '\nCopying BetterBalance.mcc\n')
  181.         (help (cat 'This MUI class is needed by ' @app-name))
  182.         (source 'Libs/mui/libs/BetterBalance.mcc')
  183.         (dest 'MUI:Libs/mui')
  184.     )
  185.  
  186.     (copylib
  187.         (prompt '\nCopying twflists.library\n')
  188.         (help (cat 'This library is needed by ' @app-name))
  189.         (source 'Libs/twflists.library')
  190.         (dest (tackon Installdir 'Libs'))
  191.     )
  192.  
  193. )
  194. ;;;
  195. ;;; Copy or update data files
  196. (procedure CopyData
  197.     (foreach 'Data' '#?'
  198.         (if (not (exists (tackon (tackon InstallDir 'Data') @each-name)))
  199.             (set CopyThis True)
  200.             (if (earlier (tackon (tackon InstallDir 'Data') @each-name) (tackon 'Data' @each-name))
  201.                 (set CopyThis True)
  202.                 (set CopyThis False)
  203.             )
  204.         )
  205.         (if (= CopyThis True)
  206.             (copyfiles
  207.                 (prompt 'Copying datafiles')
  208.                 (help 'Copying datafiles')
  209.                 (source (tackon 'Data' @each-name))
  210.                 (dest (tackon InstallDir 'data'))
  211.             )
  212.         )
  213.     )    
  214. )
  215. ;;;
  216. ;;; Modify user-startup
  217. (procedure AddAssign
  218.     (startup
  219.         @app-name
  220.         (prompt AssignPrompt)
  221.         (help AssignHelp)
  222.         (confirm)
  223.         (command (cat 'Assign >NIL: ADD: ' InstallDir))
  224.     )
  225. )
  226. ;;;
  227.  
  228.  
  229. ;;; ========================== Main installation ==========================
  230. (SetStrings)
  231. (SayHello)
  232. (CheckForInstall)
  233. (GetDrawer)
  234. (GetIconSet)
  235. (CopyMain)
  236. (CopyIcons)
  237. (CopyClasses)
  238. (CopyData)
  239. (AddAssign)
  240. (exit)
  241. ;;;
  242.  
  243.  
  244.  
  245.